
import request from "@/util/serve.js"
//jyj
/**
 * 管理员登陆
 */
export let adminlogin = (username, password) => {
    return request({

        url: "/user/login",
        method: "POST",
        data: {
            username, password
        }
    })
}

/**
 * 退出登录
 */
export let tui = (username, password) => {
    return request({
        url: "/user/logout",
        method: "GET",
        data: {
            username, password
        }
    })
}
//商品列表
export let shop = (current, size) => {
    return request({
        url: '/goods/getAll',
        method: 'GET',
        params: {
            current, size
        }
    })
}
//添加商品
export let update = (favprice, gid, imgurl, price, proid, proname, tool) => {
    return request({
        url: '/goods/update',
        method: 'POST',
        data: {
            favprice, gid,
            imgurl,
            price, proid,
            proname,
            tool
        }
    })
}
//单删商品
export let goodsdelete = (id) => {
    return request({
        url: '/goods/delete',
        method: 'DELETE',
        params: {
            id
        }
    })
}
//搜索商品
export let goodsblursearch = (current, key, size) => {
    return request({
        url: '/goods/blursearch',
        method: 'GET',
        params: {
            current, key, size
        }
    })
}
//多条件查询搜索商品
export let goodssearchAll = (current, map, size) => {
    return request({
        url: '/goods/searchAll',
        method: 'GET',
        params: {
            current, map, size

        }
    })
}
//轮播图查看
export let gmlist = (data) => {
    return request({
        url: "banner/getAll",
        method: "GET",
        params: data

    })
}
//轮播图搜索
export let gmblursearch = (data) => {
    return request({
        url: "banner/blursearch",
        method: "GET",
        params: data

    })
}
//轮播图删除
export let gmdel = (data) => {
    return request({
        url: "banner/delete",
        method: "DELETE",
        params:data

    })
}
//轮播图修改
export let gmupdate = (data) => {
    return request({
        url: "banner/update",
        method: "POST",
        data
           
        
    })
}
//轮播图新增
export let gmupload = (data) => {
    return request({
        url: "banner/upload",
        method: "POST",
        data
           
        
    })
}
//售后管理列表请求(获取全部)
export const Sales = (current, size) => {
    return request({
        url: "/aftersale/getAll",
        method: "GET",
        params: {
            current, size
        }

    })
}

//售后管理列表搜索
export const Search = (current, key, size) => {
    return request({
        url: "/aftersale/blursearch",
        method: "GET",
        params: {
            current, key, size
        }
    })
}

//售后管理的总条数
export const SalesAll = (current = 1, size = 1) => {
    return request({
        url: "/aftersale/getAll",
        method: "GET",
        params: {
            current, size
        }
    })
}
//售后删除订单
export const Saledeleete = (id) => {
    return request({
        url: "/aftersale/delete",
        method: "DELETE",
        params: {
            id
        }


    })
}


